package cn.itcast.provider.controller;

import cn.itcast.provider.domain.Goods;
import cn.itcast.provider.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/goods")
public class GoodsController {
    @Autowired
    GoodsService goodsService;

    @GetMapping("/findById/{id}")
    public Goods findById(@PathVariable("id") int id){
        return goodsService.findById(id);
    }
}
